// 引入项目中全部的全局组件
import Pagination from "./Pagination/index.vue";
import SvgIcon from "./SvgIcon/index.vue";

// 引入element-plus 全部的图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 全局对象
const allGlobalComponents: any = {
  Pagination,
  SvgIcon,
};

// 对外暴露插件对象
export default {
  install(app: any) {
    Object.keys(allGlobalComponents).forEach((key) => {
      // 注册所有的全局组件
      app.component(key, allGlobalComponents[key]);
    });
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
};
